Skip to content
This repository was archived by the owner on Aug 24, 2026. It is now read-only.

fix: restore boot by updating Babel config and graphql-yoga v5 API - #39

Merged
mstuart merged 1 commit into
masterfrom
fix/babel-boot
Aug 18, 2026
Merged

fix: restore boot by updating Babel config and graphql-yoga v5 API#39
mstuart merged 1 commit into
masterfrom
fix/babel-boot

Conversation

@mstuart

@mstuart mstuart commented Aug 18, 2026

Copy link
Copy Markdown
Owner

npm start has been broken. Two separate bugs, both from dependency bumps that landed without corresponding code changes.

1. Babel config

.babelrc set useBuiltIns: 'usage' and debug, both removed in @babel/preset-env 8. require('@babel/register') threw before any app code ran:

[BABEL] The 'useBuiltIns' option has been removed. Please use babel-plugin-polyfill-corejs3 instead.

Dropped both options. targets: { node: 'current' } already means no polyfilling is needed here.

2. graphql-yoga v5 API

Fixing Babel exposed the real bug: graphql-yoga was bumped to ^5 in #35, which removed the v1 GraphQLServer constructor, so the app died with GraphQLServer is not a constructor. Ported server.js to the v5 createYoga + createSchema API served by node:http, keeping the workshop's teaching comments intact.

Verification

$ npm start
Server is running on http://localhost:4000/graphql

{hello}                 -> {"data":{"hello":"Hello World"}}
{hello(name:"Mark")}    -> {"data":{"hello":"Hello Mark"}}
GET /graphql (html)     -> 200 (GraphiQL loads)

README updated for the /graphql path and the Playground -> GraphiQL rename. Prettier clean.

Two bugs, both from dependency bumps that landed without code changes:

1. .babelrc set useBuiltIns/debug, removed in @babel/preset-env 8, so
   @babel/register threw at startup before any app code ran.
2. graphql-yoga was bumped to ^5, which removed the v1 GraphQLServer
   constructor the workshop used. Ported to createYoga/createSchema
   served by node:http.

Verified: server boots, { hello } and { hello(name:) } both resolve, and
the GraphiQL IDE loads at /graphql. README updated for the /graphql path
and the Playground -> GraphiQL rename.
@mstuart
mstuart merged commit cbb4d8a into master Aug 18, 2026
4 checks passed
@mstuart
mstuart deleted the fix/babel-boot branch August 18, 2026 21:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant